home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 5861 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.7 KB

  1. Path: news.ov.com!news
  2. From: glenn@ov.com (Fletcher.Glenn@ov.com)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Student -- need help with code changes at
  5. Date: 21 Feb 1996 17:17:21 GMT
  6. Organization: OpenVision
  7. Message-ID: <4gfk31$ni7@spanky.pls.ov.com>
  8. References: <ragnaroek1996Feb19.120437.2325@news2.compulink.com>
  9. Reply-To: glenn@ov.com
  10. NNTP-Posting-Host: foghorn.pls.ov.com
  11.  
  12. In article 2325@news2.compulink.com, epoulin@idirect.com (Eric Poulin) writes:
  13. >I'm sure this is a no-brainer that i just can't think of.  If someone does 
  14. >know,
  15. >please email me at epoulin@idirect.com.
  16. >
  17. >Thanks,
  18. >
  19. >Eric
  20. >
  21. >
  22. >The program is for teachers to enter in grades under various categories (ie.
  23. >quizes, exams)
  24. >I have defined the following structure
  25. >
  26. >typedef struct class_num {
  27. >   int numberOfQuizes;
  28. >   int numberofExams;
  29. >   int quiz1OutOf;
  30. >   int Quiz2OutOf;
  31. >
  32. >   etc...
  33. >} CLASS_NUM;
  34. >
  35. >The problem is that I want the user (teacher) to be able to change the number
  36. >of quizes given
  37. >and even add new categories (ie Attendance).  How can I do this without 
  38. >including that information in the struct?
  39. >I have a couple of ideas but none of them will work.
  40. >Any help is GREATLY appreciated.
  41. >
  42. >
  43.  
  44. It is fairly easy to make record images that are highly expandable using
  45. dynamic allocation to store the individual numbers.  However, when you 
  46. start to talk about varying the categories (at run time) in a record,
  47. you are into the domain of "database management" which is the foundation
  48. of an entire branch of the software industry.  Such companies as Informix,
  49. Sybase, and Oracle have expended 100,000 or more lines of code doing just the
  50. sort of thing you describe.  Of course, these giants are solving the more
  51. general problem of infinitely variable record structures.
  52.  
  53.             Fletcher.Glenn@ov.com
  54.  
  55.